import React, { Component } from 'react'
import PropTypes from 'prop-types'

class SubCount extends Component {
  subCount(count) {
    this.props.subClick(-count)
  }
  render() {
    return (
      <div>
        <button onClick={() => this.subCount(1)}>-1</button>
        <button onClick={() => this.subCount(5)}>-5</button>
        <button onClick={() => this.subCount(10)}>-10</button>
      </div>
    )
  }
}

SubCount.propTypes = {
  subClick: PropTypes.func
}

export default SubCount